package cn.edu.zut.score.core.convert;

import cn.edu.zut.score.core.dto.request.ReplyAddRequest;
import cn.edu.zut.score.core.dto.response.ReplyResponse;
import cn.edu.zut.score.core.entity.Reply;
import io.swagger.annotations.ApiModel;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author zby
 * @date 2021/06/29
 */
@ApiModel("答辩相关转换器")
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface ReplyConvert {

    ReplyConvert INSTANCE = Mappers.getMapper(ReplyConvert.class);

    ReplyResponse reply2Response(Reply reply);

    List<ReplyResponse> replys2Responses(List<Reply> replies);

    Reply add2Reply(ReplyAddRequest replyAddRequest);
}
